package org.huanletao.ssm.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * <p>
 * </p>
 * package: org.huanletao.ssm.controller
 * description:
 * className: IndexController
 * author:  踏雪无痕
 * copyright: Copyright (c) 2022/8/28 15:47
 * since: 1.0.0
 */
@Controller
public class IndexController {

    private static final Logger log = LoggerFactory.getLogger(IndexController.class);

    @GetMapping("/index")
    public String index(Model model){
        Subject subject = SecurityUtils.getSubject();
        model.addAttribute("user",subject.getPrincipal());
        return "index";
    }
}
